Matrix Attributes
The attributes of a matrix, such as how many rows it has, are
accessible in several ways. All attributes are accesible through
function calls, for example:
> my_matrix = [ 1, 0.333, 0.367, 0.24;
> 6, -0.3, 0.9, 3];
> show(my_matrix)
name: my_matrix
class: num
type: real
nr: 2
nc: 4
> size(my_matrix)
2 4
> length(my_matrix)
4
> class(my_matrix)
num
> type(my_matrix)
real
> name(my_matrix)
my_matrix
You can learn more about each of those functions by refering to the
Function Reference, or by using the on-line help.
Matrix attributes are also accessible via a shorthand notation:
> // Number of rows
> my_matrix.nr
2
> // Number of columns
> my_matrix.nc
4
> // Number of elements
> my_matrix.n
8
> // Class of variable
> my_matrix.class
num
> // Type of contents
> my_matrix.type
real